package response

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

type Codes int64

type ResponseData struct {
	Code Codes       `json:"code"`
	Msg  interface{} `json:"msg"`
	Data interface{} `json:"data"`
}

func ResponseDataError(c *gin.Context, data interface{}) {
	c.JSON(http.StatusOK, &ResponseData{
		Code: 500,
		Msg:  "失败",
		Data: data,
	})
}
func ResponseDataSuccess(c *gin.Context, data interface{}) {
	c.JSON(http.StatusOK, &ResponseData{
		Code: 200,
		Msg:  "成功",
		Data: data,
	})
}
